package com.lagou.service.impl;

import com.lagou.dao.EmployeeDao;
import com.lagou.domain.Employee;
import com.lagou.service.EmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class EmployeeServiceImpl implements EmployeeService {

    @Autowired
    private EmployeeDao employeeDao;

    public List<Employee> findAll() {

        List<Employee> emps = employeeDao.findAll();
        return emps;
    }

    @Override
    public void save(Employee employee) {

        employeeDao.save(employee);
    }

    @Override
    public void deleteBatch(Integer[] ids) {

        employeeDao.deleteBatch(ids);
    }

    @Override
    public Employee findById(Integer emp_id) {

        return employeeDao.findById(emp_id);
    }

    @Override
    public void update(Employee employee) {

        employeeDao.update(employee);
    }


}
